package cn.base.day08;

public class Test07 {
    public static void main(String[] args) {

        StringBuilder s1 = new StringBuilder();
        StringBuilder s2 = new StringBuilder("acaasdas");
        System.out.println(s2);
        //增加内容
        s2.append("ffffff");
        s2.append("mmmmmmm");
        System.out.println(s2);

        //删除
        s2.delete(0, 5);
        System.out.println(s2);//dasffffffmmmmmmm

        //修改 把索引为2的字符 改为x
        s2.setCharAt(2, 'x');
        System.out.println(s2);//daxffffffmmmmmmm

        //遍历查看
        for (int i = 0; i < s2.length(); i++) {
            System.out.print(s2.charAt(i) + " ");
        }
    }
}
